package com.dzjcloud.dzj.upms.api.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * <h3>dzj-cloud</h3>
 * <p>修改用户密码表单</p>
 *
 * @author : DongZeJian
 * @date : 2021-06-01 15:49
 **/
@ApiModel("修改用户密码表单")
@Data
public class UpdateUserPasswrodForm implements Serializable {

    @ApiModelProperty(value = "密码",name = "passwrod",required = true)
    @NotBlank(message = "密码不能为空")
    private String passwrod;

    /**
     * 用户新密码密码
     */
    @ApiModelProperty(value = "新密码",name = "newPasswrod",required = true)
    @NotBlank(message = "新密码不能为空")
    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$",message = "由数字和字母组成，并且要同时含有数字和字母，且长度要在8-16位之间。")
    private String newPasswrod;

    @ApiModelProperty(value = "验证码",required = true)
    @NotBlank(message = "验证码不能为空")
    private String verification;

    public void setVerification(String verification){
        this.verification=verification.toLowerCase();
    }
}
